<template>
  <div>
    <h6 class="mb10" style="text-align: right" v-if="showTime.assetsPeriodStart && showTime.assetsPeriodEnd">
      {{ showTime.assetsPeriodStart }}至{{ showTime.assetsPeriodEnd }}
    </h6>
    <div class="box" v-for="(item, index) in assetsLiabilitiesInfo" :key="index">
      <div class="content1">
        <p v-if="item.assetName">{{ item.assetName.trim() }}</p>
        <p v-else>--</p>
      </div>
      <div class="content2">{{ item.item || '--' }}</div>
      <div class="content3">{{ item.assetEndBalance == 0 ? 0 : item.assetEndBalance || '--' }}</div>
      <div class="content4">{{ item.assetStartBalance == 0 ? 0 : item.assetStartBalance || '--' }}</div>
      <div class="content5">
        <p v-if="item.equityName">{{ item.equityName.trim() }}</p>
        <p v-else>--</p>
      </div>
      <div class="content6">{{ item.equityEndBalance == 0 ? 0 : item.equityEndBalance || '--' }}</div>
      <div class="content7">{{ item.equityStartBalance == 0 ? 0 : item.equityStartBalance || '--' }}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'AssetsLiabilitiesInfo',
  props: {
    assetsLiabilitiesInfo: Array,
    showTime: Object,
  },
  data() {
    return {}
  },
}
</script>

<style lang="scss" scoped>
.box {
  @include flex();
  border-left: 1px solid $gray-lighter;
  border-right: 1px solid $gray-lighter;
  border-top: 1px solid $gray-lighter;
  &:last-child {
    border-bottom: 1px solid $gray-lighter;
  }
  > div {
    width: calc(100% / 7);
    height: 40px;
    text-align: center;
    line-height: 40px;
    color: $gray;
    &:not(:nth-child(7n)) {
      border-right: 1px solid $gray-lighter;
    }
    &.content1,
    &.content5 {
      min-width: 20%;
      background-color: #fafafa;
    }
  }
}
</style>
